import request from "./request";
import bodyParse from "./bodyParse";

export async function postFetch({ url, params, method }) {
  return request("/gauss" + url, {
    method: method ?? "POST",
    data: params,
  });
}

export async function getFetch({ url, params }) {
  return request("/gauss" + url + bodyParse(params));
}

export async function formFetch({ url, params }) {
  return request("/gauss" + url, {
    method: "POST",
    data: params,
    type: "form",
  });
}
